<?php

class DatabaseSeeder extends Seeder {

	/**
	 * Run the database seeds.
	 *
	 * @return void
	 */
	public function run()
	{
		Eloquent::unguard();

		$this->call('ItemTableSeeder');
		$this->call('UserTableSeeder');
	}

}

class ItemTableSeeder extends Seeder {
	public function run(){
		
		DB::table('items')->delete();

		$faker = Faker\Factory::create();
		for ($i = 0; $i < 50; $i++)
		{
		  $vendor = Item::create(array(
		  		'charname'	=> $faker->userName,
				'item'		=> $faker->sentence(3),
				'price'		=> $faker->numberBetween(500,10000000),
				'location'	=> $faker->secondaryAddress,
				'itemcode'	=> $faker->unique()->bothify('??##?')
		  	));
		}
		
		$this->command->info('Item SEEDED');
		
	}
}